package com.yonyou.cyxdms.basedata.service.entity.region;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.yonyou.cyx.function.utils.bean.BeanMapperUtil;
import com.yonyou.cyxdms.framework.bean.dto.base.DMSBaseDTO;
import com.yonyou.cyxdms.framework.bean.entity.base.DMSBasePO;

/**
 * <p>
 * 地区表
 * </p>
 *
 * @author renwd
 * @since 2018-12-19
 */
@TableName("tm_region")
public class RegionPO extends DMSBasePO<RegionPO> {

    private static final long serialVersionUID = 1L;

    /**
     * 地区ID
     */
    @TableId(value = "REGION_ID", type = IdType.AUTO)
    private Long regionId;

    /**
     * 地区代码
     */
    @TableField("REGION_CODE")
    private String regionCode;
    /**
     * 地区中文名称
     */
    @TableField("REGION_NAME")
    private String regionName;
    /**
     * 地区英文名称
     */
    @TableField("REGION_ENAME")
    private String regionEname;
    /**
     * 国家、省份、城市、区县
     */
    @TableField("REGION_TYPE")
    private Integer regionType;
    /**
     * 父区域ID
     */
    @TableField("PARENT_REGION_ID")
    private Long parentRegionId;

    /**
     * 首字母
     */
    @TableField("INITIAL")
    private String initial;

    /**
     * 以下是车营销增加的数据
     */
    @TableField("HOT_CITY")
    private Integer hotCity;

    /**
     * APP_ID
     */
    @TableField("APP_ID")
    private String appId;

    public Long getRegionId() {
        return regionId;
    }

    public void setRegionId(Long regionId) {
        this.regionId = regionId;
    }

    public String getRegionCode() {
        return regionCode;
    }

    public void setRegionCode(String regionCode) {
        this.regionCode = regionCode;
    }

    public String getRegionName() {
        return regionName;
    }

    public void setRegionName(String regionName) {
        this.regionName = regionName;
    }

    public String getRegionEname() {
        return regionEname;
    }

    public void setRegionEname(String regionEname) {
        this.regionEname = regionEname;
    }

    public Integer getRegionType() {
        return regionType;
    }

    public void setRegionType(Integer regionType) {
        this.regionType = regionType;
    }

    public Long getParentRegionId() {
        return parentRegionId;
    }

    public void setParentRegionId(Long parentRegionId) {
        this.parentRegionId = parentRegionId;
    }

    public String getInitial() {
        return initial;
    }

    public void setInitial(String initial) {
        this.initial = initial;
    }

    public Integer getHotCity() {
        return hotCity;
    }

    public void setHotCity(Integer hotCity) {
        this.hotCity = hotCity;
    }

    public String getAppId() {
        return appId;
    }

    public void setAppId(String appId) {
        this.appId = appId;
    }

    @Override
    public String toString() {
        return "RegionPO{" +
                "regionId=" + regionId +
                ", regionCode='" + regionCode + '\'' +
                ", regionName='" + regionName + '\'' +
                ", regionEname='" + regionEname + '\'' +
                ", regionType=" + regionType +
                ", parentRegionId=" + parentRegionId +
                ", initial='" + initial + '\'' +
                ", hotCity=" + hotCity +
                ", appId=" + appId +
                '}';
    }

    /**
     * 将PO 信息转化为DTO
     *
     * @param dto 需要进行转换的dto
     * @author renwd
     * @since 2018/7/22 0022
     */
    protected <T extends DMSBaseDTO> void transDtoToPo(T dto) {
        BeanMapperUtil.copyProperties(this, dto, "regionId");
    }


}
